<template>
  <div class="mui-numbox" data-numbox-step="1" data-numbox-min="0" data-numbox-max="max">
    <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
    <input class="mui-numbox-input" type="number" value=1 @change="countChange" ref="countValue">
    <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
   
  </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {
  data() {
    return {};
  },
  mounted() {
    // 初始化数字选择框组件
    mui(".mui-numbox").numbox();
    console.log(this.max);
  },
  methods: {
    countChange() {
      // console.log(this.$refs.countValue.value,123);
      this.$emit("func", this.$refs.countValue.value);
    }
  },
  props:["max"],
  watch:{
    "max":function(newVal,oldVal){
      console.log(newVal,7788);
      mui(".mui-numbox").numbox().setOption('max',newVal)
    }
  }
};
</script>
